From f5c808b428244f42b2310ddf173c624d9a2a842c Mon Sep 17 00:00:00 2001 From: Ian Campbell Date: Mon, 18 Oct 2010 16:53:04 +0100 Subject: [PATCH] libxc: use correct size of struct xen_mc We want the size of the struct not the pointer (although rounding up to page size in lock_pages probably saves us). Signed-off-by: Ian Campbell Signed-off-by: Ian Jackson --- tools/libxc/xc_misc.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/tools/libxc/xc_misc.c b/tools/libxc/xc_misc.c index a5f179a403..47acdb2fb8 100644 --- a/tools/libxc/xc_misc.c +++ b/tools/libxc/xc_misc.c @@ -153,7 +153,7 @@ int xc_mca_op(xc_interface *xch, struct xen_mc *mc) DECLARE_HYPERCALL; mc->interface_version = XEN_MCA_INTERFACE_VERSION; - if ( lock_pages(xch, mc, sizeof(mc)) ) + if ( lock_pages(xch, mc, sizeof(*mc)) ) { PERROR("Could not lock xen_mc memory"); return -EINVAL; @@ -162,7 +162,7 @@ int xc_mca_op(xc_interface *xch, struct xen_mc *mc) hypercall.op = __HYPERVISOR_mca; hypercall.arg[0] = (unsigned long)mc; ret = do_xen_hypercall(xch, &hypercall); - unlock_pages(xch, mc, sizeof(mc)); + unlock_pages(xch, mc, sizeof(*mc)); return ret; } #endif -- 2.30.2